package ru.aslanov.schedule.server;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * Created: Feb 24, 2010 4:15:17 PM
 *
 * @author Sergey Aslanov
 */
public class LogoutServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        final AccessManager am = AccessManager.getInstance();
        AccessManager.removeInstance();
        response.sendRedirect(am.getLogoutUrl(am.getLoginUrl("/")));
    }
}
